{% if response %}
<div id="response">{{ response }}</div>
{% endif %}

<table id='bugs' count='{{ test_case.get_bugs.count }}' class="list" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<th class="widthID">Case Run ID</th>
		<th class="widthID">Run ID</th>
		<th>Bug URL</th>
        <th>Action</th>
       
	</tr>
	{% for bug in test_case.get_bugs %}
	<tr class="{% cycle 'even' 'odd' %}">
		<td>{{ bug.case_run_id }}</td>
		<td>{% if bug.case_run_id %}<a href="{% url "testruns-get" bug.case_run.run_id %}">{{ bug.case_run.run_id }}</a>{% else %}None{% endif %}</td>
		<td><a href="{{ bug.get_full_url }}">{{ bug.get_full_url }}</a></td>
        <td>
			{% if perms.testcases.delete_bug %}
			<a class="remove js-remove-button" data-params='{"id": "{{ bug.bug_id }}", "caseId": "{{ test_case.pk }}", "caseRunId": "{{ bug.case_run_id|default:'' }}"}'>Remove</a>
			{% else %}
			<label class="grey">None</label>
			{% endif %}
		</td>
	</tr>
	{% empty %}
	<tr>
		<td colspan="4" align="center" class="grey">No bug related to this case.</td>
	</tr>
	{% endfor %}
</table>
{% if message %}
	<div id="message" class="hidden">{{ message }}</div>
{% endif %}
